package com.gitee.starblues.grape.core.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gitee.starblues.grape.core.service.ChailvProviderProductService;
import com.gitee.starblues.grape.repository.databases.entity.ChailvProviderProduct;
import com.gitee.starblues.grape.repository.databases.mapper.ChailvProviderProductMapper;
import com.gitee.starblues.grape.rest.model.vo.ProviderProductVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

import static com.gitee.starblues.grape.rest.common.ResultUtils.errorLog;

/**
 * @author l.zhu3
 * @date 2025/1/25 21:38
 */
@Service
@Slf4j
public class ChailvProviderProductServiceImpl extends ServiceImpl<ChailvProviderProductMapper, ChailvProviderProduct> implements ChailvProviderProductService {

    @Resource
    private ChailvProviderProductMapper chailvProviderProductMapper;

    @Override
    public List<ProviderProductVO> getProductList(String productCode, String channelType) {
        try {
            return chailvProviderProductMapper.selectByProductCode(productCode, channelType);
        } catch (Exception e) {
            errorLog(log, e, "查询返利列表失败");
            return null;
        }
    }
}
